import 'package:flutter/material.dart';

class ProductInfoPage extends StatefulWidget {
  final Map arguments;
  ProductInfoPage({Key? key, required this.arguments}) : super(key: key);

  @override
  State<ProductInfoPage> createState() =>
      _ProductInfoPageState(arguments: this.arguments);
}

class _ProductInfoPageState extends State<ProductInfoPage> {
  Map arguments;
  //required this.arguments 表示arguments是必须传入的命名参数
  _ProductInfoPageState({required this.arguments});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("商品详情页面")),
      body: Container(
        child: Text("pid = ${arguments['pid']}"),
      ),
    );
  }
}
